import request from '@/utils/request'

// 新增
export function AddDataAPI(data) {
  return request({
    url: '/system/bom',
    method: 'POST',
    data
  })
}

// 修改
export function EditDataAPI(data) {
  return request({
    url: '/system/bom/edit',
    method: 'PUT',
    data
  })
}

// 删除
export function DelDataAPI(query) {
  return request({
    url: '/system/bom/' + query,
    method: 'DELETE'
  })
}

// 详情
export function GetDelDataAPI(query) {
  return request({
    url: '/system/bom/' + query,
    method: 'get'
  })
}

// 列表 bom信息查询
export function GetListAPI(query) {
  return request({
    url: '/system/bom/list',
    method: 'get',
    params: query
  })
}

// 列表 查询bom明细信息分页
export function GetListDetailAPI(query) {
  return request({
    url: '/system/bom/listDetail',
    method: 'get',
    params: query
  })
}

// 列表 辅料查询分页
export function GetlistDetailAmAPI(query) {
  return request({
    url: '/system/bom/listDetailAm',
    method: 'get',
    params: query
  })
}

// 以下都是更新ui后的接口
// Bom列表-树结构表格
export function getTreeListAPI(query) {
  return request({
    url: 'system/newBom/BomList',
    method: 'GET',
    params: query
  })
}
// 复制Bom下拉
export function getCopyBomAPI(query) {
  return request({
    url: 'system/newBom/copyBom',
    method: 'GET',
    params: query
  })
}

// 新增
export function addDataAPI(data) {
  return request({
    url: '/system/newBom/add',
    method: 'POST',
    data
  })
}

// 修改
export function editDataAPI(data) {
  return request({
    url: '/system/newBom/edit',
    method: 'PUT',
    data
  })
}

// 详情
export function seeDataAPI(data) {
  return request({
    url: '/system/newBom/view/' + data,
    method: 'get'
  })
}

// 删除
export function delDataAPI(data) {
  return request({
    url: '/system/newBom/delete/' + data,
    method: 'DELETE'
  })
}

// 拉取
export function jdyBomHalfPullAPI(data) {
  return request({
    url: '/system/newBom/jdyBomHalfPull',
    method: 'GET',
    data
  })
}

// 物料拉取拉取
export function pullMaterialAPI(data) {
  return request({
    url: '/system/newBom/pullMaterial',
    method: 'GET',
    data
  })
}

// bom 提交
export function SubmitAPI(data) {
  return request({
    url: '/system/newBom/submitReview',
    method: 'PUT',
    data
  })
}

// bom 审核
export function PurchaseOrderReviewAPI(data) {
  return request({
    url: '/system/newBom/batchAudit',
    method: 'PUT',
    data
  })
}

// bom 审核
export function antiAuditAPI(data) {
  return request({
    url: '/system/newBom/antiAudit',
    method: 'PUT',
    data
  })
}
